# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidDeviceProvisioning.V1.Model.DevicesLongRunningOperationMetadata do
  @moduledoc """
  Tracks the status of a long-running operation to asynchronously update a batch of reseller metadata attached to devices. To learn more, read [Long‑running batch operations](/zero-touch/guides/how-it-works#operations).

  ## Attributes

  *   `devicesCount` (*type:* `integer()`, *default:* `nil`) - The number of metadata updates in the operation. This might be different from the number of updates in the request if the API can't parse some of the updates.
  *   `processingStatus` (*type:* `String.t`, *default:* `nil`) - The processing status of the operation.
  *   `progress` (*type:* `integer()`, *default:* `nil`) - The processing progress of the operation. Measured as a number from 0 to 100. A value of 10O doesn't always mean the operation completed—check for the inclusion of a `done` field.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :devicesCount => integer() | nil,
          :processingStatus => String.t() | nil,
          :progress => integer() | nil
        }

  field(:devicesCount)
  field(:processingStatus)
  field(:progress)
end

defimpl Poison.Decoder,
  for: GoogleApi.AndroidDeviceProvisioning.V1.Model.DevicesLongRunningOperationMetadata do
  def decode(value, options) do
    GoogleApi.AndroidDeviceProvisioning.V1.Model.DevicesLongRunningOperationMetadata.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AndroidDeviceProvisioning.V1.Model.DevicesLongRunningOperationMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
